package com.ld.security.server.admin.modules.lan.vo;

import com.ld.security.common.core.base.SuperVo;
import com.ld.security.common.mybatis.anno.QueryKey;
import com.ld.security.common.mybatis.anno.SqlKeys;
import com.ld.security.server.admin.modules.lan.entity.LanViewEntity;
import lombok.Data;

import java.util.Map;

/**
 * 语言详情
 */
@Data
public class LangDetailsVo implements SuperVo {



    @QueryKey(groupKey = {"langCode","code"})
    @SqlKeys
    private Map<String,Map<String,LanViewEntity>> docuMap;


    /**
     * 得到国际化的值
     * @param langCode
     * @param docuCode
     * @param eleCode
     * @return
     */
    public Map<String,String> getView(String langCode,String docuCode){
        Map map =  docuMap.get(langCode).get(docuCode).getEleConfig().toMap("prop","value");

        return map;
    }
    /**
     * 得到国际化的值
     * @param langCode
     * @param docuCode
     * @param eleCode
     * @return
     */
    public String getButton(String langCode,String docuCode,String eleCode){
        Map map =  getView(langCode,docuCode);
        String val = (String) map.get(eleCode);
        return val;
    }

}
